<?php
/**
 * file created on 29-mag-2006
 * jaco_at_pixeldump_dot_org
 * creating buttons with only hit area
 */

include("sample_utils.php");                               // provides some utils and using mk

$swfFN = "btarea.swf";                                     // swf file name to ouput

$shape1 = new MKShapeContainer();                         // a shape ...
$shape1->add_fillStyle_solid();                            // ... with default black color
$shape1->add_rect();                                       // ... and a 100x100 default rect
$shapeTD1 = $shape1->update_tagData();                     // get tag data

$button1 = new MKButtonContainer("", 2);                  // a button
$buttonTD1 = $button1->build_button_state($shape1, "hit"); // with only "hit" state
$buttonPB1 = $button1->update_place_tagData();             // place tag data

$swf = new MKSwf($swfFN);                                  // the swf to generate
$swf->set_swfDir(SERVER_MKTMP);                            // set output directory
$swf->add_tagData($shapeTD1);                              // start to populate
$swf->add_tagData($buttonTD1);                             // ...
$swf->add_tagData($buttonPB1);                             // ...
$swf->swf_output();

$swfHeader = $swf->fetch_assoc();                          // prepare to publish to the browser

$str = "<div style=\"width:600; height:500; background-color:#EEEEEE; text-align:center\"><br />";
$str .= render_swf_box($swfHeader, $imgDir, false);
$str .= "<br/><strong>" .$swfFN ." created in :<br />" .SERVER_MKTMP ."</strong>";
$str .= "<br/>hit area is in the top left until 100,100</div>";
echo show_content($str, basename(__FILE__));
?>
